<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
 <html xmlns="http://www.w3.org/1999/xhtml"  
    xmlns:ui="http://java.sun.com/jsf/facelets"  
    xmlns:h="http://java.sun.com/jsf/html"  
    xmlns:f="http://java.sun.com/jsf/core"> 
<h:head>
	<title>Cadastro de Imóvel</title>	
	<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css" />
	<link rel="stylesheet" href="../css/bootstrap-responsive.min.css" type="text/css" />
</h:head>

 <h:body>
 
 <h:form>
 	<table>
 	    <tr>
 			<td><h:outputLabel value="Status: " style="color:#FF0000;" /></td>
 			<td>
 				<h:selectOneMenu value="#{imovelMB.status}">  
	    			<f:selectItem itemLabel="Ativo" itemValue="1" />  
	    			<f:selectItem itemLabel="Inativo" itemValue="0" />
				</h:selectOneMenu> 
			</td>
		</tr> 
		
 		<tr>
 			<td><h:outputLabel value="Nome:" style="color:#FF0000;" /></td>
 			<td><h:inputText value="#{imovelMB.nome}" required="true" 
 				requiredMessage="Preencha o campo Nome do Imóvel!" /></td>
 		</tr>
		<tr>
			<td><h:outputLabel value="Cliente" style="color:#FF0000;" /></td>
			<td><h:selectOneMenu value="#{imovelMB.idCliente}">
            		<f:selectItems value="#{imovelMB.listaCliente}" />
				</h:selectOneMenu> 
			</td>
		</tr>
		
		<tr>
			<td><h:outputLabel value="Funcionário" style="color:#FF0000;" /></td>
			<td><h:selectOneMenu value="#{imovelMB.idFuncionario}">
            		<f:selectItems value="#{imovelMB.listaFuncionario}" />
				</h:selectOneMenu> 
			</td>
		</tr>
		
		<tr>
			<td><h:outputLabel value="Tipo de Imóvel" style="color:#FF0000;" /></td>
			<td><h:selectOneMenu value="#{imovelMB.idTipoImovel}" label="tipoImovel">
            		<f:selectItems value="#{imovelMB.listaTipoImovel}" 
            			var="tipo" itemLabel="#{tipo.descricao}" itemValue="#{tipo.id}"/>
				</h:selectOneMenu>   
			</td>
		</tr>
		
		<tr>
			<td><h:outputLabel value="Situação" style="color:#FF0000;" /></td>
				
			<td><h:selectOneMenu value="#{imovelMB.situacao}">
            		<f:selectItem itemLabel="Planta" itemValue="0"  />
            		<f:selectItem itemLabel="Novo" itemValue="1" />
            		<f:selectItem itemLabel="Usado" itemValue="2" />
				</h:selectOneMenu> 
			</td>
		</tr>
 	
 		<tr>
 			<td><h:outputLabel value="Valor:" style="color:#FF0000;" /></td>
 			<td><h:inputText value="#{imovelMB.valor}" required="true" 
 				requiredMessage="Preencha o campo Valor do Imóvel!"/></td>
 		</tr>	
 		
 		<tr>
 			<td><h:outputLabel value="Descrição:" style="color:#FF0000;" /></td>
 			<td><h:inputText value="#{imovelMB.descricao}" required="true" 
 				requiredMessage="Preencha o campo Descrição do Imóvel!"/></td>
 		</tr>
 		
 		<tr>
 			<td><h:outputLabel value="Foto" style="color:#FF0000;" /></td>
 			<td><h:inputText value="#{imovelMB.foto_capa}" required="true" 
 				requiredMessage="Preencha o campo foto do Imóvel!"/></td>
 		</tr>	

		
		<tr>		    
			<td><h:commandButton action="#{imovelMB.save}" value="Gravar" class="btn btn-primary"/><br/></td> 
		</tr>
		
		<tr>
	   		<td><h:messages id="msgErro" style="color: red"></h:messages></td>
			<td><h:outputText value="#{imovelMB.msgAviso}" /></td>
		</tr>
	</table> 
 			
</h:form>
</h:body>
</html>
